
// ShipCustomiser configuration file
// J.H. Moritz Kraft, 12 May 2008
// written for Sixth Fleet DaDB


// Namespace
if ( typeof ( SF ) == "undefined" ) var SF = {};
if ( typeof ( SF.Components ) == "undefined" ) SF.Components = {};


//////////////////////
/// //////////////////
/// Initialisation ///
/// //////////////////
//////////////////////

$( document ).ready( function() {
  if ( !SF.hasOwnProperty( "ShipCustomiser" ) ) return;
  SF.ShipCustomiser.initialise(
  {
    // UI config:
    width: 600,                            // width of the <div/> tag that houses this thing
    // app config:
  })
});


////////////////////////
/// ////////////////////
/// Application data ///
/// ////////////////////
////////////////////////

/// Hull classes

SF.Hulls = {
  title: "Hull class",
  rows: [
    // 1st dataset:
    {
      id: 1,            // unique identifier, integer value
      title: "Akira",   // title of the ship class, string
      facilitates:
      {
        structure: 1000, // available structural points, integer value
      },
      requires:
      {
        crew: 5         // minimum crew required (just the hull and minor stuff, not counting vital systems), integer value
      }
    },
    // 2nd dataset:
    {
      id: 2,
      title: "Galaxy",
      facilitates: { structure: 3000 },
      requires: { crew: 10 }
    },
    // more datasets:
    { id: 3, title: "Nebula", facilitates: { structure: 2500 }, requires: { crew: 10 } },
    { id: 4, title: "Prometheus", facilitates: { structure: 1500 }, requires: { crew: 0 } }
  ]
};

/// Components

// Engine types

SF.Components.WarpEngines = {
  title: "Warp engine",
  rows: [
    // 1st dataset:
    {
      id: 1,                 // unique identifier, integer value
      title: "Class 1 MARA", // title of the engine type, string
      requires:
      {
        structure: 200,      // required structural points, integer value
        crew: 10             // required personnel to operate this system
      },
      facilitates:
      {
        power: 5000          // available power, integer value
      }
    },
    // more datasets:
    {
      id: 2,
      title: "Class 2 MARA",
      requires: { structure: 1200, crew: 15 },
      facilitates: { power: 50000 }
    },
    {
      id: 3,
      title: "Class 3 MARA",
      requires: { structure: 2500, crew: 25 },
      facilitates: { power: 250000 }
    }
  ]
};

// Living quarters

SF.Components.Quarters = {
  title: "Crew quarters",
  rows: [
    { id: 1, title: "Standard",           requires: { structure: 2 }, facilitates: { crew: 1 } },
    { id: 2, title: "Luxury / Adaptable", requires: { structure: 4 }, facilitates: { crew: 1 } },
    { id: 3, title: "2-person shared",    requires: { structure: 4 }, facilitates: { crew: 2 } },
    { id: 4, title: "Family",             requires: { structure: 6 }, facilitates: { crew: 2 } },
    { id: 5, title: "4-person shared",    requires: { structure: 6 }, facilitates: { crew: 4 } }
  ]
};

// Tactical systems

SF.Components.Phasers = {
  title: "Phasers",
  rows: [
    {
      id: 1,
      title: "Type X Phaser",
      requires:
      {
        structure: 100,
        power: 3000,
        crew: 1
      }
    }
  ]
};
